package com.ckx.base;

import lombok.Getter;

@SuppressWarnings("unused")
@Getter
public class BizException extends RuntimeException {
    @Override
    public Throwable fillInStackTrace() {
        return this;
    }

    private final int code;

    private final String msg;

    private Object[] args;

    public BizException(ExceptionEnum bizEnum) {
        super(bizEnum.msg());
        this.code = bizEnum.code();
        this.msg = bizEnum.msg();
    }

    public BizException(ExceptionEnum bizEnum, Object[] args) {
        super(bizEnum.msg());
        this.code = bizEnum.code();
        this.msg = bizEnum.msg();
        this.args = args;
    }

    public BizException(int code, String msg, Object[] args) {
        this.code = code;
        this.msg = msg;
        this.args = args;
    }

}
